<div class="notification-main">
	<div class="History-box">
	  <h1 class="title">Won Auctions</h1>

<?php $this->widget('zii.widgets.grid.CGridView', 
      array(
      'id'=>'won-grid',
      'dataProvider'=>$wauction->search_my(),
    
      'columns'=>array(
            array(	
            		'type'=>'raw',
            		'name'=>'title',
            		'value' => function($data){return "<a href='".Yii::app()->baseUrl."/index/detail?auction_id=$data->auction_id'>".$data->getAuctionInfo()->title."</a>";},
            ),
            array(
            		'name'=>'end_time',
            		'value' => function($data){return  date('Y-m-d H:i:s',$data->getAuctionInfo()->end_time);},
            ),
            
            array(
              'name'=>'quantity',
              'value' => '$data->quantity',
            ),
            array(
              'name'=>'price',
              'value' =>'"$".$data->price',
            ),
            array(
              'name'=>'Shipping',
              'header'=>'Shipping',
              'value' => '"$".$data->shipping_fee',
            ),
            array(
              'name'=>'Total Paid',
              'value' =>'"$".round(($data->total_price-$data->count_price),2)',
              ),
            array(
            		'type'=>'raw',
            		'name'=>'pay',
            		'value' => function($data){ 
            		if($data->status==1)
            		    return "<a href='".Yii::app()->baseUrl."/checkout?id=".$data->getAuctionInfo()->id."'>
            		    <button class='btn submit-btn cancel'>pay</button></a>";
                    },
            ),
        ),
)); ?>
	</div>
</div>
<script type="text/javascript">
// function click(id){
// 	location.href='/checkout?id='+id;
// }
</script>